<dd class="mr20 tc">
    <span><a href="javascript:void(0)" id="choose_attach" onclick="choice_pz_imgs()" style="text-decoration: underline;">选择原始单据</a></span>
    <span class="attach_wrap">附单据 <span id="vch_attach">{$count_imgs|default=0}</span> 张</span>
</dd>
<input type="hidden" name="imgs" value="{$imgs}" id="imgs">
<script type="text/javascript">
	function choice_pz_imgs() {
		var img=$("#imgs").val();
		var string_arr = img.split(',');
		console.log("11111");
		console.log(img);
		layer.open({
			type: 2,
			title: "选择凭证",
			shadeClose: true,
			shade: 0.3,
			maxmin: false, //开启最大化最小化按钮
			area: ['80%', '85%'],
			fixed: false, //不固定
			btn: ['确定', '取消'],
			content: "/admin/basic/choose_pz_imgs.html?imgs="+string_arr,
			btn1: function (index, layero) {
				var body = layer.getChildFrame('body', index);
				var imgs_ids = $(layero).find("iframe")[0].contentWindow.ids();//调用子页面formData()方法
				if (imgs_ids == 0) {
					layer.msg("请选择凭证");
					return false;
				} else {
					// var ids_arr = imgs_ids.split(",");
					//console.log(imgs_ids.length);
					var ids_arr= imgs_ids.join(",");
					//console.log(ids_arr);
					$('#vch_attach').html(imgs_ids.length);
					$('#imgs').val(ids_arr);
				}
				layer.close(index);
				return false;
			},
			btn4: function (index, layero) {
				layer.close(index);
				return false;
			}
		})
	}
</script>